local jLootz = jLootz
local lib = jLootz:NewModule("Monitor")

function lib:OnEnable()
	jLootz.RegisterCallback(self, "LOOT_ITEM")
	jLootz.RegisterCallback(self, "LOOT_MONEY")
end

function lib:OnDisable()
	jLootz.UnregisterCallback(self, "LOOT_ITEM")
	jLootz.UnregisterCallback(self, "LOOT_MONEY")
end

local print = function (s, ...)
	if s:find("%", nil, true) then
		s = s:format(...)
	else
		s = string.join(" ", s, ...)
	end
	ChatFrame1:AddMessage("jLootz_Monitor: "..s)
end

function lib:LOOT_ITEM(event, who, what, count)
	print(event, who, what, count)
end

function lib:LOOT_MONEY(event, who, count)
	print(event, who, count)
end
